#include "gp2x/gl.h"

int render(int frame) {
    float i;

    switch(frame) {
    case 0:
        for(i=-0.5; i < 0.5; i += 0.1) {
            glBegin(GL_LINES);
            glVertex3f(-0.5, i, 0.0);
            glVertex3f( 0.5, i, 0.0);
            glEnd();
        }

        glFlip();
        return 1;
    case 1:
        for(i=-0.5; i < 0.5; i += 0.1) {
            glBegin(GL_LINES);
            glVertex3f(i, -0.5, 0.0);
            glVertex3f(i,  0.5, 0.0);
            glEnd();
        }

        glFlip();
        return 1;
    case 2:
        for(i=-0.5; i < 0.5; i += 0.1) {
            glBegin(GL_LINES);
            glVertex3f(i, -0.5, 0.0);
            glVertex3f(i+0.1,  0.5, 0.0);
            glEnd();
        }

        glFlip();
        return 1;
    case 3:
        for(i=-0.5; i < 0.5; i += 0.1) {
            glBegin(GL_LINES);
            glVertex3f(i+0.1, -0.5, 0.0);
            glVertex3f(i,  0.5, 0.0);
            glEnd();
        }

        glFlip();
        return 1;
    case 4:
        for(i=-0.5; i < 0.5; i += 0.1) {
            glBegin(GL_LINES);
            glVertex3f(-0.5, i, 0.0);
            glVertex3f( 0.5, i+0.1, 0.0);
            glEnd();
        }

        glFlip();
        return 1;
    case 5:
        for(i=-0.5; i < 0.5; i += 0.1) {
            glBegin(GL_LINES);
            glVertex3f(-0.5, i+0.1, 0.0);
            glVertex3f( 0.5, i, 0.0);
            glEnd();
        }

        glFlip();
        return 0;
    default:
        return 0;
    }
}
